<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>读者中心 - 图书借阅系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .sidebar {
            background-color: white;
            min-height: calc(100vh - 56px);
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .sidebar .nav-link {
            color: #495057;
            padding: 15px 20px;
            border-bottom: 1px solid #dee2e6;
        }
        .sidebar .nav-link:hover {
            background-color: #f8f9fa;
            color: #007bff;
        }
        .sidebar .nav-link.active {
            background-color: #007bff;
            color: white;
        }
        .content {
            padding: 20px;
        }
        .card-stats {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container-fluid">
            <a class="navbar-brand" href="/">
                <i class="fas fa-book"></i> 图书借阅系统
            </a>
            <div class="navbar-nav ms-auto">
                <span class="navbar-text me-3">
                    欢迎, ${reader.name}
                </span>
                <a class="nav-link" href="/reader/logout">退出登录</a>
            </div>
        </div>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-md-3">
                <div class="sidebar">
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link active" href="/reader/dashboard">
                                <i class="fas fa-tachometer-alt me-2"></i>个人中心
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/reader/profile">
                                <i class="fas fa-user me-2"></i>个人信息
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/borrow/myRecords">
                                <i class="fas fa-book me-2"></i>借阅记录
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/book/list">
                                <i class="fas fa-search me-2"></i>图书搜索
                            </a>
                        </li>
                    </ul>
                </div>
            </div>

            <!-- 主内容区 -->
            <div class="col-md-9">
                <div class="content">
                    <h2>个人中心</h2>
                    <hr>
                    
                    <div class="row">
                        <div class="col-md-4">
                            <div class="card card-stats">
                                <div class="card-body text-center">
                                    <i class="fas fa-book fa-3x mb-3"></i>
                                    <h4>当前借阅</h4>
                                    <h2>0</h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="card card-stats" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
                                <div class="card-body text-center">
                                    <i class="fas fa-clock fa-3x mb-3"></i>
                                    <h4>即将到期</h4>
                                    <h2>0</h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="card card-stats" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
                                <div class="card-body text-center">
                                    <i class="fas fa-history fa-3x mb-3"></i>
                                    <h4>总借阅</h4>
                                    <h2>0</h2>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row mt-4">
                        <div class="col-md-6">
                            <div class="card">
                                <div class="card-header">
                                    <h5 class="mb-0">个人信息</h5>
                                </div>
                                <div class="card-body">
                                    <p><strong>姓名:</strong> ${reader.name}</p>
                                    <p><strong>用户名:</strong> ${reader.username}</p>
                                    <p><strong>邮箱:</strong> ${reader.email}</p>
                                    <p><strong>电话:</strong> ${reader.phone}</p>
                                    <p><strong>最大借阅数:</strong> ${reader.maxBooks}</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="card">
                                <div class="card-header">
                                    <h5 class="mb-0">快速操作</h5>
                                </div>
                                <div class="card-body">
                                    <a href="/book/list" class="btn btn-primary mb-2 w-100">
                                        <i class="fas fa-search"></i> 搜索图书
                                    </a>
                                    <a href="/borrow/myRecords" class="btn btn-info mb-2 w-100">
                                        <i class="fas fa-book"></i> 查看借阅记录
                                    </a>
                                    <a href="/reader/profile" class="btn btn-secondary w-100">
                                        <i class="fas fa-user"></i> 修改个人信息
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>